///					Supplementary analysis i.e., Section B in appendix

//								Daniel Tuki

*I have provided the pooled data derived from the Rounds 5 to 9 Afrobarometer surveys conducted between 2013 to 2022. To derive the descriptive staytistics in Table B1 and the regression results reported in Table B2, use he codes below: 


//	 Table B1: Descriptive Statistics (Pooled data: Rounds 5–9)

summ mili_rule bin_mili_rule ind_corrupt deprive_index acled trust_mil age gender educ nightlight 



// 	Table B2: Correlates of support for military rule (Pooled data: Rounds 5–9)

*Model 1: Corruption only 
regress mili_rule ind_corrupt, vce(cluster REGION)
*To obtain the AIC statistic
estat ic

*Model 2: Deprivation only
regress mili_rule deprive_index, vce(cluster REGION)
*To obtain the AIC statistic
estat ic

*Model 3: political instability only
regress mili_rule acled, vce(cluster REGION)
*To obtain the AIC statistic
estat ic

*Model 4: Adding the 3 explanatory variables in the same models
regress mili_rule ind_corrupt deprive_index acled, vce(cluster REGION)
*To obtain the AIC statistic
estat ic

*Model 5: Adding control variables
regress mili_rule ind_corrupt deprive_index acled trust_mil age gender educ nightlight, vce(cluster REGION)
*To obtain the AIC statistic
estat ic

*Model 6: Adding fixed effects for ethnicity and region
regress mili_rule ind_corrupt deprive_index acled trust_mil age gender educ nightlight i.ethnic i.REGION i.year, vce(cluster REGION)
*To obtain the AIC statistic
estat ic

*Model 7: Using LPM as an alternative estimation method - with binary dependent variable
regress bin_mili_rule ind_corrupt deprive_index acled trust_mil age gender educ nightlight i.ethnic i.REGION i.year, vce(cluster REGION)
*To obtain the AIC statistic
estat ic




///						Codes used to develop the variables in the survey rounds
/*					
* Although i have estimated the pooled regression modelreported in Table B2 using questions that wee asked accross various rounds of survey, the question number for the items vary in the respective questionnaires. Thismade it necessary for me to write unique codes for each round of the survey data before i appended the variables from the respective rounds to create the pooled dataset. Below are the codes used to develop the relevant variables for each of the survey rpounds (i.e., Rounds 5 to 9). These codes would work on the raw Afrobaromter dataset for Niger obtained from the database. To access the survey questionnaires and data for the various rounds of the survey, visit: https://www.afrobarometer.org/



//						*ROUND 9 CODES [2022]**
					
					
*	Dependent variable

*Military rule (mili_rule) (Q22B): This measures the attitudes of respondents towards military rule.
gen mili_rule = Q22B
*To treat "Don't know" and "Refused to answer" responses as missing: 
replace mili_rule = . if mili_rule > 5



*Military rule binary (bin_mili_rule): This is a reduced form of the variable measuring support for military intervention where I code responses in support of the intervention as 1 and responses in opposition to it and those that are neutrral as 0.  
gen bin_mili_rule = 0
replace bin_mili_rule = 1 if mili_rule == 5
replace bin_mili_rule = 1 if mili_rule == 4
replace bin_mili_rule = . if mili_rule == .



*	Explanatory variables

// Socioeconomic deprivation index (deprive_index) (Q6A-E): This measures the frequency with which respondents go without food (Q6A), drinking water (6B), medication (6C), Fuel to cook food (6D), and cash income (6E). 

*Frequency of going without food
gen food = Q6A

*Frequency of going without drinking water
gen water = Q6B

*Frequency of going without medicine or medical care
gen medicine = Q6C

*Frequency of going without fuel to cook food
gen fuel = Q6D
*To treat "don't know response as missing:
replace fuel = . if fuel == 9

*Frequency of going without cash income
gen income = Q6E
*To treat "don't know response as missing:
replace income = . if income == 9


*To develop an additive indicator that combines all these five items:
gen deprive_index = food + water + medicine + fuel + income

*To obtain the Cronbach Alpha statistic for the five items
alpha food water medicine fuel income


// Corruption index (ind_corrupt) (Q38A, Q38B, and Q38F): This is an additive indicator that measures the extent to whcih respondents perceive corruption in the executive, legislative, and judiciary arms of the government. 

*Corruption in the presidency:
gen pres_corrupt = Q38A
*To treat "don't know" and "refused to answer" responses as missing:
replace pres_corrupt = . if pres_corrupt > 3

*Corruption in national assembly
gen assem_corrupt = Q38B
*To treat "don't know" and "refused to answer" responses as missing":
replace assem_corrupt = . if assem_corrupt > 3

*Corruption in judiciary
gen judge_corrupt = Q38F
*To treat "don't know" and "refused to answer" responses as missing:
replace judge_corrupt = . if judge_corrupt > 3

*To generate additive indicator for corruption in the three tiers of government (ind_corrupt)
gen ind_corrupt = pres_corrupt + assem_corrupt + judge_corrupt

*To determine the internal reliability of these three items (Cronbach alpha):
alpha pres_corrupt assem_corrupt judge_corrupt


// Political instability (acled): This measures the total number of violent conflicts in the egion where the respondes reside from 1997 to 2021. This variable is based on the ACLED dataset. 



//	Control variables

*Age [Q1]: This is the age of the respondent. 
gen age = Q1
* To treat "don't know" responses as missing: 
replace age = . if age == 999

*Gender (gender) [Q100]: This is a dummy variable that takes the value of 1 if the respondent is male and 0 if female
gen gender = Q100
replace gender = 0 if gender == 2

*Educational attainment (educ) [Q94]: This measures the highest level of education attained by the respondents on an ordinal scale with ten categories. 
gen educ = Q94 
*To code "don't know" resposes as zero:
replace educ = . if educ == 99 
replace educ = . if educ == -1 

*Nighttime light (night): This measures the mean annual nighttime light in the region where the respondent resides in 2020.  

*	Ethnic group (ethnic) [Q84]: This indicates the ethnic group to which the respondent belongs.
gen ethnic = Q84A
*To treat "Don't know" and "refused to answer" responses as missing: 
replace ethnic = . if ethnic > 2000

*Region [REGION]: This is unique numerical code for the region where he respodent resides. 

* Trust in military (trust_mil): this measures the degree to whcih the population trusts the military. 
gen trust_mil = Q37H
*To treat "don't know" and "refused to answer responses as missing"
replace trust_mil = . if trust_mil > 3
replace trust_mil = . if trust_mil == -1







//							*ROUND 8 CODES [2020]**


*	Dependent variable

*Military rule (mili_rule) (Q20B): This measures the attitru=tudes of respondents towards military rule.
gen mili_rule = Q20B
*To treat "Don't know" and "Refused to answer" responses as missing: 
replace mili_rule = . if mili_rule > 5



*Military rule binary (bin_mili_rule): This is a reduced form of the variable measuring support for military intervention where I code responses in support of the intervention as 1 and responses in opposition to it and those that are neutrral as 0. 
gen bin_mili_rule = 0
replace bin_mili_rule = 1 if mili_rule == 5
replace bin_mili_rule = 1 if mili_rule == 4
replace bin_mili_rule = . if mili_rule == .



*	Explanatory variables

// Socioeconomic deprivation index (deprive_index) (Q7A-E): This measures the frequency with which respondents go without food (Q7A), drinking water (7B), medication (7C), Fuel to cook food (7D), and cash income (7E). 

*Frequency of going without food
gen food = Q7A
*To treat "don't know" and "refused to answer" responses as missing:
replace food = . if food > 4

*Frequency of going without drinking water
gen water = Q7B
*To treat "don't know" and "refused to answer" responses as missing:
replace water = . if water > 4

*Frequency of going without medicine or medical care
gen medicine = Q7C
*To treat "don't know" and "refused to answer" responses as missing:
replace medicine = . if medicine > 4

*Frequency of going without fuel to cook food
gen fuel = Q7D
*To treat "don't know" response as missing:
replace fuel = . if fuel > 4

*Frequency of going without cash income
gen income = Q7E
*To treat "don't know" responses as missing:
replace income = . if income > 4

*To develop an additive indicator that combines all these five items:
gen deprive_index = food + water + medicine + fuel + income

*To obtain the Cronbach Alpha statistic for the five items
alpha food water medicine fuel income


// Corruption index (ind_corrupt) (Q42A, Q42B, and Q42F): This is an additive indicator that measures the extent to whcih respondents perceive corruption in the executive, legislative, and judiciary arms of the government. 

*Corruption in the presidency:
gen pres_corrupt = Q42A
*To treat "don't know" and "refused to answer: responses as missing:
replace pres_corrupt = . if pres_corrupt > 3

*Corruption in national assembly
gen assem_corrupt = Q42B
*To treat "don't know" and "refused to answer" responses as missing:
replace assem_corrupt = . if assem_corrupt > 3

*Corruption in judiciary
gen judge_corrupt = Q42F
*To treat "don't know" and "refused to answer" responses as missing:
replace judge_corrupt = . if judge_corrupt > 3

*To generate additive indicator for corruption in the three tiers of government (ind_corrupt)
gen ind_corrupt = pres_corrupt + assem_corrupt + judge_corrupt

*To determine the internal reliability of these three items (Cronbach alpha):
alpha pres_corrupt assem_corrupt judge_corrupt


// Political instability (acled): This measures the total number of violent conflicts in the egion where the respondes reside from 1997 to 2019. This variable is based on the ACLED dataset. 



//	Control variables

*Age [Q1]: This is the age of the respondent. 
gen age = Q1
* To treat "don't know" responses as missing: 
replace age = . if age == 999

*Gender (gender) [Q101]: This is a dummy variable that takes the value of 1 if the respondent is male and 0 if female
gen gender = Q101
replace gender = 0 if gender == 2

*Educational attainment (educ) [Q94]: This measures the highest level of education attained by the respondents on an ordinal scale with ten categories. 
gen educ = Q97
*To code "don't know" resposes as zero:
replace educ = . if educ == 99 
replace educ = . if educ == -1 

*Nighttime light (night): This measures the mean annual nighttime light in the region where the respondent resides in 2019. 

*	Ethnic group (ethnic) [Q84]: This indicates the ethnic group to which the respondent belongs.
gen ethnic = Q81
*To treat "Don't know" and "refused to answer" responses as missing: 
replace ethnic = . if ethnic > 2000

*Region [REGION]: This is unique numerical code for the region where he respodent resides. 

* Trust in military (trust_mil): this measures the degree to whcih the population trusts the military. 
gen trust_mil = Q41H
*To treat "don't know" and "refused to answer" responses as missing:
replace trust_mil = . if trust_mil > 3
replace trust_mil = . if trust_mil == -1





//							*ROUND 7 CODES [2018]**


*	Dependent variable

*Military rule (mili_rule) (Q2B): This measures the attitru=tudes of respondents towards military rule.
gen mili_rule = Q27B
*To treat "Don't know" and "Refused to answer" responses as missing: 
replace mili_rule = . if mili_rule > 5



*Military rule binary (bin_mili_rule): This is a reduced form of the variable measuring support for military intervention where I code responses in support of the intervention as 1 and responses in opposition to it and those that are neutrral as 0. 
gen bin_mili_rule = 0
replace bin_mili_rule = 1 if mili_rule == 5
replace bin_mili_rule = 1 if mili_rule == 4
replace bin_mili_rule = . if mili_rule == .


*	Explanatory variables

// Socioeconomic deprivation index (deprive_index) (Q8A-E): This measures the frequency with which respondents go without food (Q8A), drinking water (8B), medication (8C), Fuel to cook food (8D), and cash income (8E). 

*Frequency of going without food
gen food = Q8A
*To treat "don't know" and "refused to answer" responses as missing:
replace food = . if food > 4

*Frequency of going without drinking water
gen water = Q8B
*To treat "don't know" and "refused to answer" responses as missing:
replace water = . if water > 4

*Frequency of going without medicine or medical care
gen medicine = Q8C
*To treat "don't know" and "refused to answer" responses as missing:
replace medicine = . if medicine > 4

*Frequency of going without fuel to cook food
gen fuel = Q8D
*To treat "don't know" response as missing:
replace fuel = . if fuel > 4

*Frequency of going without cash income
gen income = Q8E
*To treat "don't know" response as missing:
replace income = . if income > 4

*To develop an additive indicator that combines all these five items:
gen deprive_index = food + water + medicine + fuel + income

*To obtain the Cronbach Alpha statistic for the five items:
alpha food water medicine fuel income


// Corruption index (ind_corrupt) (Q44A, Q44B, and Q44F): This is an additive indicator that measures the extent to whcih respondents perceive corruption in the executive, legislative, and judiciary arms of the government. 

*Corruption in the presidency:
gen pres_corrupt = Q44A
*To treat "don't know" and "refused to answer" responses as missing:
replace pres_corrupt = . if pres_corrupt > 3

*Corruption in national assembly
gen assem_corrupt = Q44B
*To treat "don't know" and "refused to answer" responses as missing:
replace assem_corrupt = . if assem_corrupt > 3

*Corruption in judiciary
gen judge_corrupt = Q44F
*To treat "don't know" and "refused to answer" responses as missing:
replace judge_corrupt = . if judge_corrupt > 3

*To generate additive indicator for corruption in the three tiers of government (ind_corrupt):
gen ind_corrupt = pres_corrupt + assem_corrupt + judge_corrupt

*To determine the internal reliability of these three items (Cronbach alpha):
alpha pres_corrupt assem_corrupt judge_corrupt


// Political instability (acled): This measures the total number of violent conflicts in the egion where the respondes reside from 1997 to 2017. This variable is based on the ACLED dataset. 



//	Control variables

*Age [Q1]: This is the age of the respondent. 
gen age = Q1
* To treat "don't know" responses as missing: 
replace age = . if age == 999

*Gender (gender) [Q101]: This is a dummy variable that takes the value of 1 if the respondent is male and 0 if female
gen gender = Q101
replace gender = 0 if gender == 2

*Educational attainment (educ) [Q94]: This measures the highest level of education attained by the respondents on an ordinal scale with ten categories. 
gen educ = Q97
*To code "don't know" resposes as zero:
replace educ = . if educ == 99 
replace educ = . if educ == -1 

* Nighttime light (night): This measures the mean annual nighttime light in the region where the respondent resides in 2017. 

*	Ethnic group (ethnic) [Q84]: This indicates the ethnic group to which the respondent belongs.
gen ethnic = Q84
*To treat "Don't know" and "refused to answer" responses as missing: 
replace ethnic = . if ethnic > 2000

*Region [REGION]: This is unique numerical code for the region where he respodent resides. 

* Trust in military (trust_mil): this measures the degree to whcih the population trusts the military. 
gen trust_mil = Q43H
*To treat "don't know" and "refused to answer responses as missing"
replace trust_mil = . if trust_mil > 3
replace trust_mil = . if trust_mil == -1





//							*ROUND 6 CODES [2015]**


*	Dependent variable

*Military rule (mili_rule) (Q28B): This measures the attitru=tudes of respondents towards military rule.
gen mili_rule = Q28B
*To treat "Don't know" and "Refused to answer" responses as missing: 
replace mili_rule = . if mili_rule > 5
*To treat the missing value coded as -1 as missing:
replace mili_rule = . if mili_rule == -1


*Military rule binary (bin_mili_rule): This is a reduced form of the variable measuring support for military intervention where I code responses in support of the intervention as 1 and responses in opposition to it and those that are neutrral as 0. 
gen bin_mili_rule = 0
replace bin_mili_rule = 1 if mili_rule == 5
replace bin_mili_rule = 1 if mili_rule == 4
replace bin_mili_rule = . if mili_rule == .


*	Explanatory variables

// Socioeconomic deprivation index (deprive_index) (Q8A-E): This measures the frequency with which respondents go without food (Q8A), drinking water (8B), medication (8C), Fuel to cook food (8D), and cash income (8E). 

*Frequency of going without food
gen food = Q8A
*To treat "don't know" and "refused to answer" responses as missing:
replace food = . if food > 4

*Frequency of going without drinking water
gen water = Q8B
*To treat "don't know" and "refused to answer" responses as missing:
replace water = . if water > 4

*Frequency of going without medicine or medical care
gen medicine = Q8C
*To treat "don't know" and "refused to answer" responses as missing:
replace medicine = . if medicine > 4

*Frequency of going without fuel to cook food
gen fuel = Q8D
*To treat "don't know" response as missing:
replace fuel = . if fuel > 4

*Frequency of going without cash income
gen income = Q8E
*To treat "don't know" response as missing:
replace income = . if income > 4

*To develop an additive indicator that combines all these five items:
gen deprive_index = food + water + medicine + fuel + income

*To obtain the Cronbach Alpha statistic for the five items
alpha food water medicine fuel income



// Corruption index (ind_corrupt) (Q53A, Q53B, and Q53G): This is an additive indicator that measures the extent to whcih respondents perceive corruption in the executive, legislative, and judiciary arms of the government. 

*Corruption in the presidency:
gen pres_corrupt = Q53A
*To treat "don't know" and "refused to answer" responses as missing:
replace pres_corrupt = . if pres_corrupt > 3

*Corruption in national assembly
gen assem_corrupt = Q53B
*To treat "don't know" and "refused to answer" responses as missing:
replace assem_corrupt = . if assem_corrupt > 3

*Corruption in judiciary
gen judge_corrupt = Q53G
*To treat "don't know" and "refused to answer" responses as missing:
replace judge_corrupt = . if judge_corrupt > 3

*To generate additive indicator for corruption in the three tiers of government (ind_corrupt)
gen ind_corrupt = pres_corrupt + assem_corrupt + judge_corrupt

*To determine the internal reliability of these three items (Cronbach alpha):
alpha pres_corrupt assem_corrupt judge_corrupt


// Political instability (acled): This measures the total number of violent conflicts in the egion where the respondes reside from 1997 to 2014. This variable is based on the ACLED dataset. 



//	Control variables

*Age [Q1]: This is the age of the respondent. 
gen age = Q1
* To treat "don't know" responses as missing: 
replace age = . if age == 999

*Gender (gender) [Q101]: This is a dummy variable that takes the value of 1 if the respondent is male and 0 if female
gen gender = Q101
replace gender = 0 if gender == 2

*Educational attainment (educ) [Q94]: This measures the highest level of education attained by the respondents on an ordinal scale with ten categories. 
gen educ = Q97
*To code "don't know" resposes as zero:
replace educ = . if educ == 99 
replace educ = . if educ == -1 

*Nighttime light (night): This measures the mean annual nighttime light in the region where the respondent resides in 2014. 

*	Ethnic group (ethnic) [Q87]: This indicates the ethnic group to which the respondent belongs.
gen ethnic = Q87
*To treat "Don't know" and "refused to answer" responses as missing: 
replace ethnic = . if ethnic > 2000

*Region [REGION]: This is unique numerical code for the region where he respodent resides. 

* Trust in military (trust_mil): this measures the degree to whcih the population trusts the military. 
gen trust_mil = Q52I
*To treat "don't know" and "refused to answer" responses as missing:
replace trust_mil = . if trust_mil > 3
replace trust_mil = . if trust_mil == -1




//							*ROUND 5 CODES**


*	Dependent variable

*Military rule (mili_rule) (Q31B): This measures the attitru=tudes of respondents towards military rule.
gen mili_rule = Q31B
*To treat "Don't know" and "Refused to answer" responses as missing: 
replace mili_rule = . if mili_rule > 5
*To treat the missing value coded as -1 as missing:
replace mili_rule = . if mili_rule == -1


*Military rule binary (bin_mili_rule): This is a reduced form of the variable measuring support for military intervention where I code responses in support of the intervention as 1 and responses in opposition to it and those that are neutrral as 0. 
gen bin_mili_rule = 0
replace bin_mili_rule = 1 if mili_rule == 5
replace bin_mili_rule = 1 if mili_rule == 4
replace bin_mili_rule = . if mili_rule == .


*	Explanatory variables

// Socioeconomic deprivation index (deprive_index) (Q8A-E): This measures the frequency with which respondents go without food (Q8A), drinking water (8B), medication (8C), Fuel to cook food (8D), and cash income (8E). 

*Frequency of going without food
gen food = Q8A
*To treat "don't know" and "refused to answer" responses as missing:
replace food = . if food > 4

*Frequency of going without drinking water
gen water = Q8B
*To treat "don't know" and "refused to answer" responses as missing:
replace water = . if water > 4

*Frequency of going without medicine or medical care
gen medicine = Q8C
*To treat "don't know" and "refused to answer" responses as missing:
replace medicine = . if medicine > 4

*Frequency of going without fuel to cook food
gen fuel = Q8D
*To treat "don't know" response as missing:
replace fuel = . if fuel > 4

*Frequency of going without cash income
gen income = Q8E
*To treat "don't know" response as missing:
replace income = . if income > 4

*To develop an additive indicator that combines all these five items:
gen deprive_index = food + water + medicine + fuel + income

*To obtain the Cronbach Alpha statistic for the five items
alpha food water medicine fuel income

*To derive the histogram plotting the deprivation index [Figure 4]
histogram deprive_index, freq


// Corruption index (ind_corrupt) (Q60A, Q60B, and Q60G): This is an additive indicator that measures the extent to whcih respondents perceive corruption in the executive, legislative, and judiciary arms of the government. 

*Corruption in the presidency:
gen pres_corrupt = Q60A
*To treat "don't know" and "refused to answer" responses as missing:
replace pres_corrupt = . if pres_corrupt > 3

*Corruption in national assembly
gen assem_corrupt = Q60B
*To treat "don't know" and "refused to answer" responses as missing;
replace assem_corrupt = . if assem_corrupt > 3

*Corruption in judiciary
gen judge_corrupt = Q60G
*To treat "don't know" and "refused to answer" responses as missing:
replace judge_corrupt = . if judge_corrupt > 3

*To generate additive indicator for corruption in the three tiers of government (ind_corrupt)
gen ind_corrupt = pres_corrupt + assem_corrupt + judge_corrupt

*To determine the internal reliability of these three items (Cronbach alpla: 0.76)
alpha pres_corrupt assem_corrupt judge_corrupt


// Political instability (acled): This measures the total number of violent conflicts in the egion where the respondes reside from 1997 to 2012. This variable is based on the ACLED dataset. 


//	Control variables

*Age [Q1]: This is the age of the respondent. 
gen age = Q1
* To treat "don't know" responses as missing: 
replace age = . if age == 999

*Gender (gender) [Q101]: This is a dummy variable that takes the value of 1 if the respondent is male and 0 if female
gen gender = Q101
replace gender = 0 if gender == 2

*Educational attainment (educ) [Q94]: This measures the highest level of education attained by the respondents on an ordinal scale with ten categories. 
gen educ = Q97
*To code "don't know" resposes as zero:
replace educ = . if educ == 99 
replace educ = . if educ == -1 

* Nighttime light (night): This measures the mean annual nighttime light in the region where the respondent resides in 2012.

*	Ethnic group (ethnic) [Q84]: This indicates the ethnic group to which the respondent belongs.
gen ethnic = Q84
*To treat "Don't know" and "refused to answer" responses as missing: 
replace ethnic = . if ethnic > 2000

*Region [REGION]: This is unique numerical code for the region where he respodent resides. 

* Trust in military (trust_mil): this measures the degree to whcih the population trusts the military. 
gen trust_mil = Q59I
*To treat "don't know" and "refused to answer" responses as missing:
replace trust_mil = . if trust_mil > 3
replace trust_mil = . if trust_mil == -1





